package core.db.springjpa.example.test;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.data.domain.PageRequest;

import core.db.springjpa.example.service.UserService;
import core.tool.common.SystemInfo;

public class SimpleSpringJpaDemo {
	
    public static void main(String[] args) {
//        ApplicationContext ctx = new ClassPathXmlApplicationContext("spring-demo-cfg.xml");
    	
        ApplicationContext ctx = new FileSystemXmlApplicationContext(SystemInfo.ROOT_PATH+"config/spring-demo-cfg.xml");
    	
        UserService userService = ctx.getBean("userService", UserService.class);
        
//        userService.createNewAccount("g", "ggg", 700);
        System.out.println(userService.findByBalanceGreaterThan(100, new PageRequest(1, 2)));
    }
}
